import {get, post} from "../../utils/req";
import {alert} from "../../components/common/alert";

export const getToken = async (data) => {
    try {
        return await post('/login', data);
    } catch (e) {
        alert(`登录失败：${e}`, 'error');
        return null;
    }
}

export const getUserInfo = async () => {
    try {
        return await get('/private/user/info');
    } catch (e) {
        alert(`登录失败：${e}`, 'error');
        return null;
    }
}
